class CreateVideoFiles < ActiveRecord::Migration
  def self.up
    create_table :video_files do |t|
      t.column :parent_id, :integer
      t.column :content_type, :string
      t.column :filename, :string
      t.column :size, :integer
      t.column :width, :integer
      t.column :height, :integer
      t.column :processing_status, :integer
      t.timestamps
    end
  end

  def self.down
    VideoFile.find(:all).each do |video_file|
      video_file.delete
    end
    Media.find(:all, :conditions => ["mediable_type = ?", "VideoFile"]).each do |media|
      media.destroy
    end
    drop_table :video_files
  end
end
